import { Tree } from 'antd';
import { useComponentStore } from '../../editor/stores/components';

export function Outline(){
    const { components, setCurComponentId } = useComponentStore()
    
    return (
        <Tree
            fieldNames={{title: 'desc', key: 'id'}}
            showLine
            defaultExpandAll
            onSelect={([key]) => setCurComponentId(String(key))}
            treeData={components as any}
        />
    )
}